/*
	YoghurtGum - 2D Game Engine

	Copyright 2009-2011 Quinten Lansu
	
	Licensed under the Apache License, Version 2.0 (the "License"); you may not 
	use this file except in compliance with the License. You may obtain a copy 
	of the License at 
		
		http://www.apache.org/licenses/LICENSE-2.0 
		
	Unless required by applicable law or agreed to in writing, software 
	distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 
	WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 
	License for the specific language governing permissions and limitations 
	under the License. 
*/

#ifndef _YGINPUT_H_
#define _YGINPUT_H_

#include "YGSources.h"
#include "YGVec2.h"

#if (YG_OS_TYPE == YG_OS_TYPE_WINDOWSMOBILE)

	#include "WM6\YGInputDefWM6.h"

#elif (YG_OS_TYPE == YG_OS_TYPE_ANDROID)

	#include "Android\YGInputDefAndroid.h"

#elif (YG_OS_TYPE == YG_OS_TYPE_BADA)

	#include "Bada\YGInputDefBada.h"

#endif

namespace YoghurtGum
{

	class Vec2;

	struct Engine;

#if YG_OS_TYPE == YG_OS_TYPE_ANDROID

	typedef unsigned short Key;

	typedef struct 
	{
		struct timeval Keytime;
		unsigned short type;
		unsigned short code;
		unsigned int value;
	} input_event;

#elif YG_OS_TYPE == YG_OS_TYPE_WINDOWSMOBILE


#endif

	class Keyboard
	{

	public:

		virtual void Init() = 0;
		virtual void Clear() = 0;
		virtual void Update() = 0;

		virtual bool Pressed(Key a_Key) = 0;
		virtual bool Released(Key a_Key) = 0;

		virtual void InjectPress(Key a_Key) = 0;
		virtual void InjectRelease(Key a_Key) = 0;

		static Keyboard& Get();

	protected:

		Keyboard();
		~Keyboard();

		static Keyboard* s_Instance;

	}; YG_ALIGN // class Keyboard

	class TouchScreen
	{

	public:

		virtual Vec2 GetPos() = 0;
		virtual float GetX() = 0;
		virtual float GetY() = 0;
		virtual int GetScreenX() = 0;
		virtual int GetScreenY() = 0;

		virtual bool Released() = 0;
		virtual bool Pressed() = 0;

		virtual void Init() = 0;
		virtual void Resize(int a_Width, int a_Height) = 0;
		virtual void InjectPress(float a_X, float a_Y) = 0;
		virtual void InjectRelease(float a_X, float a_Y) = 0;
		virtual void Clear() = 0;

		static TouchScreen& Get();

	protected:

		TouchScreen();
		~TouchScreen();

		static TouchScreen* s_Instance;

	}; // class TouchScreen
	
};

#endif
